package com.example.initmethoddemo;

import org.springframework.boot.context.event.ApplicationStartedEvent;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;


/**
 * @Description: Lisnert
 * @author: LiuYC
 * 注意 启动类加上注解 @ServletComponentScan
 * @date: 2021年04月23日 10:27
 */
@WebListener
public class TestListener implements ServletContextListener {
    @Override
    public void contextDestroyed(ServletContextEvent arg0) {
        System.out.println("【监听器 StartListener】 contextDestroyed method %%%%%%%%%%%%%%%%");
    }
    @Override
    public void contextInitialized(ServletContextEvent arg0) {
        System.out.println("【监听器 StartListener】StartListener contextInitialized method %%%%%%%%%%%%%%");
        System.out.println("在监听器中做一些预处理..........");
    }
}
